Page({
  /**
   * 页面的初始数据
   */
  data: {
    header: null,
    role: {
      2: {
        'name': '战士',
        'desc': '输出和生存能力都比较突出的近攻英雄。团战中站于坦克身后，有时也会充当先锋，承受大量伤害。',
        'cover': '../../img/role/cwarrior.png'
      },
      4: {
        'name': '法师',
        'desc': '生存能力较弱，但输出强力且兼具控制技能的英雄。团战中占据后排位置，对敌方英雄进行输出控制。',
        'cover': '../../img/role/cmage.png'
      },
      1: {
        'name': '坦克',
        'desc': '生存能力较强、输出能力一般的英雄。团战中占据前排位置，抵挡掉较多的敌方输出伤害。',
        'cover': '../../img/role/ctank.png'
      },
      3: {
        'name': '刺客',
        'desc': '生存能力较弱，但输出能力爆炸的英雄。团战中可绕后一套技能秒杀敌方后排的脆皮输出。',
        'cover': '../../img/role/cassassin.png'
      },
      5: {
        'name': '射手',
        'desc': '远程输出能力极高且带有控制技能的英雄。团战中利用自身“手长”的优势站于后排进行输出控制。',
        'cover': '../../img/role/carcher.png'
      },
      6: {
        'name': '辅助',
        'desc': '生存能力和输出能力略平庸的英雄，单靠强力的技能效果来为队友增加状态及控制敌方英雄。',
        'cover': '../../img/role/csupport.png'
      }
    },
    herolist:[]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var id = parseInt(options.role),
      header_data = this.data.role[id];
    this.setData({ header: header_data});
    if(id==1){
    var herolist1 = [{ hero_id: 1, hero_avatar: "../../img/hero/hero1/caocao.jpg", hero_name: "曹操", isNew: false },
      { hero_id: 2, hero_avatar: "../../img/hero/hero1/donghuangtaiyi.JPG", hero_name: "东皇太一", isNew: false },
      { hero_id: 3, hero_avatar: "../../img/hero/hero1/kai.JPG", hero_name: "铠", isNew: false },
      { hero_id: 4, hero_avatar: "../../img/hero/hero1/mengqi.JPG", hero_name: "梦奇", isNew: false },
      { hero_id: 5, hero_avatar: "../../img/hero/hero1/sulie.JPG", hero_name: "苏烈", isNew: false },
      { hero_id: 6, hero_avatar: "../../img/hero/hero1/sunce.JPG", hero_name: "孙策", isNew: false },
      { hero_id: 7, hero_avatar: "../../img/hero/hero1/taiyizhenren.JPG", hero_name: "太乙真人", isNew: false }

    ]
    this.setData({ herolist: herolist1 });
    }

  if(id==2) {
    var herolist2 = [{ hero_id: 1, hero_avatar: "../../img/hero/hero2/kuangtie.JPG", hero_name: "狂铁", isNew: false },
    { hero_id: 2, hero_avatar: "../../img/hero/hero2/nezha.JPG", hero_name: "哪吒", isNew: false },
    { hero_id: 3, hero_avatar: "../../img/hero/hero2/xaihoudun.JPG", hero_name: "夏侯惇", isNew: false },
    { hero_id: 4, hero_avatar: "../../img/hero/hero2/yadianna.JPG", hero_name: "雅典娜", isNew: false },
    { hero_id: 5, hero_avatar: "../../img/hero/hero2/yangjian.JPG", hero_name: "杨戬", isNew: false },
    { hero_id: 6, hero_avatar: "../../img/hero/hero2/zhongkui.JPG", hero_name: "钟馗", isNew: false }
   

    ]
    this.setData({ herolist: herolist2 });
  }

  if (id == 3) {
    var herolist3 = [{ hero_id: 1, hero_avatar: "../../img/hero/hero3/bailixuance.JPG", hero_name: "百里玄策", isNew: false },
    { hero_id: 2, hero_avatar: "../../img/hero/hero3/buzhihuowu.JPG", hero_name: "不知火舞", isNew: false },
    { hero_id: 3, hero_avatar: "../../img/hero/hero3/huamulan.JPG", hero_name: "花木兰", isNew: false },
    { hero_id: 4, hero_avatar: "../../img/hero/hero3/lanlingwang.JPG", hero_name: "兰陵王", isNew: false },
    { hero_id: 5, hero_avatar: "../../img/hero/hero3/nakelulu.JPG", hero_name: "娜可露露", isNew: false },
    { hero_id: 6, hero_avatar: "../../img/hero/hero3/peiqinhu.JPG", hero_name: "裴擒虎", isNew: false }
  

    ]
    this.setData({ herolist: herolist3 });
  }

  if (id == 4) {
    var herolist4 = [{ hero_id: 1, hero_avatar: "../../img/hero/hero4/diaochan.JPG", hero_name: "貂蝉", isNew: false },
    { hero_id: 2, hero_avatar: "../../img/hero/hero4/milaiqiu.JPG", hero_name: "米莱狄", isNew: false },
    { hero_id: 3, hero_avatar: "../../img/hero/hero4/miyue.JPG", hero_name: "芈月", isNew: false },
    { hero_id: 4, hero_avatar: "../../img/hero/hero4/mozi.JPG", hero_name: "墨子", isNew: false },
    { hero_id: 5, hero_avatar: "../../img/hero/hero4/yixing.JPG", hero_name: "弈星", isNew: false },
    { hero_id: 6, hero_avatar: "../../img/hero/hero4/zhugeliang.JPG", hero_name: "诸葛亮", isNew: false }
   
    ]
    this.setData({ herolist: herolist4 });
  }

  if (id == 5) {
    var herolist5 = [{ hero_id: 1, hero_avatar: "../../img/hero/hero5/ailin.JPG", hero_name: "艾琳", isNew: false },
    { hero_id: 2, hero_avatar: "../../img/hero/hero5/bailishouyue.JPG", hero_name: "百里守约", isNew: false },
    { hero_id: 3, hero_avatar: "../../img/hero/hero5/chengjisihan.JPG", hero_name: "成吉思汗", isNew: false },
    { hero_id: 4, hero_avatar: "../../img/hero/hero5/gongsunli.JPG", hero_name: "公孙离", isNew: false },
    { hero_id: 5, hero_avatar: "../../img/hero/hero5/huangzhong.JPG", hero_name: "黄忠", isNew: false },
    { hero_id: 6, hero_avatar: "../../img/hero/hero5/makeboluo.JPG", hero_name: "马可波罗", isNew: false },
    { hero_id: 7, hero_avatar: "../../img/hero/hero5/yuji.JPG", hero_name: "虞姬", isNew: false }

    ]
    this.setData({ herolist: herolist5 });
  }

  if (id == 6) {
    var herolist6 = [{ hero_id: 1, hero_avatar: "../../img/hero/hero6/caiwenji.JPG", hero_name: "蔡文姬", isNew: false },
    { hero_id: 2, hero_avatar: "../../img/hero/hero6/daqiao.JPG", hero_name: "大乔", isNew: false },
    { hero_id: 3, hero_avatar: "../../img/hero/hero6/guiguzi.JPG", hero_name: "鬼谷子", isNew: false },
    { hero_id: 4, hero_avatar: "../../img/hero/hero6/liubang.JPG", hero_name: "刘邦", isNew: false },
    { hero_id: 5, hero_avatar: "../../img/hero/hero6/mingzhiyin.JPG", hero_name: "明世隐", isNew: false },
    { hero_id: 6, hero_avatar: "../../img/hero/hero6/yangyuhuan.JPG", hero_name: "杨玉环", isNew: false },
    { hero_id: 7, hero_avatar: "../../img/hero/hero6/zhangfei.JPG", hero_name: "张飞", isNew: false },
    { hero_id: 8, hero_avatar: "../../img/hero/hero6/zhuangzhou.JPG", hero_name: "庄周", isNew: false },

    ]
    this.setData({ herolist: herolist6 });
  }


    
    
  }
})